package edu.hgnu.topic;

import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class TopicCustomer {
/*
    //获取所有队列信息
    @RabbitListener(bindings = {
            @QueueBinding(
                    value = @Queue,
                    exchange = @Exchange(
                            name = "topics",type = "topic"
                    ),
                    key = {
                            "*.*.*"
                    }
            )
    })
    public void test(String msg){
        System.out.println(msg);
    }*/


/*    //获取所有error的队列信息
    @RabbitListener(bindings = {
            @QueueBinding(
                    value = @Queue,
                    exchange = @Exchange(
                            name = "topics",type = "topic"
                    ),
                    key = {
                            "*.error.*"
                    }
            )
    })
    public void test1(String msg){
        System.out.println(msg);
    }*/

/*    //获取所有log.*.*队列信息
    @RabbitListener(bindings = {
            @QueueBinding(
                    value = @Queue,
                    exchange = @Exchange(
                            name = "topics",type = "topic"
                    ),
                    key = {
                            "log.*.*"
                    }
            )
    })
    public void test2(String msg){
        System.out.println(msg);
    }*/

    //获取所有log.*.*队列信息
    @RabbitListener(bindings = {
            @QueueBinding(
                    value = @Queue,
                    exchange = @Exchange(
                            name = "topics",type = "topic"
                    ),
                    key = {
                            "*.*.menus"
                    }
            )
    })
    public void test3(String msg){
        System.out.println(msg);
    }
}
